<?php
list($categories, $areas, $tags) = $this->requestAction(array('controller' => 'course', 'action' => 'getMasterData'));
$categoryConfig = Configure::read('category');
?>
<!-- .section -->
<div class="section">
	<h2 class="title">クラスを探す</h2>
	<ul class="filter">
		<li class="category">
			<a class="type" href="#">カテゴリー</a>
			<ul>
				<?php foreach ($categories as $category):?>
				<li <?php if (isset($categoryConfig[$category['Category']['rank']]['class'])):?>class="<?php echo $categoryConfig[$category['Category']['rank']]['class'];?><?php endif;?>">
					<?php echo $this->Html->link($category['Category']['name'], array('controller' => 'course', 'action' => 'index', 'type' => 'category', 'id' => $category['Category']['id']));?>
				</li>
				<?php endforeach;?>
			</ul>
		</li>
		<li class="openingDate"><a class="type" href="#">スケジュール</a>
			<ul>
				<li><?php echo $this->Html->link('今月開催予定のクラス', array('controller' => 'course', 'action' => 'index', 'type' => 'time', 'id' => 'now'));?></li>
				<li><?php echo $this->Html->link('今後開催予定のクラス', array('controller' => 'course', 'action' => 'index', 'type' => 'time', 'id' => 'future'));?></li>
				<li><?php echo $this->Html->link('以前開催されたクラス', array('controller' => 'course', 'action' => 'index', 'type' => 'time', 'id' => 'past'));?></li>
			</ul>
		</li>
		<li class="area"><a class="type" href="#">エリア</a>
			<ul>
				<?php foreach ($areas as $key => $value):?>
				<li><?php echo $this->Html->link($value, array('controller' => 'course', 'action' => 'index', 'type' => 'area', 'id' => $key));?></li>
				<?php endforeach;?>
			</ul>
		</li>
		<li class="tags"><a class="type" href="#">タグ</a>
			<ul>
				<?php foreach ($tags as $key => $value):?>
				<li><?php echo $this->Html->link($value, array('controller' => 'course', 'action' => 'index', 'type' => 'tag', 'id' => $key));?></li>
				<?php endforeach;?>
			</ul>
		</li>
	</ul>
</div>
<!-- /.section -->
<div class="section search clearfix">
	<?php echo $this->Form->create('Search', array('url' => array('controller' => 'course', 'action' => 'index'), 'id' => 'searchForm', 'type' => 'get'));?>
		<label for="keyword">Search</label>
		<?php echo $this->Form->submit('serch_off.gif', array('class' => 'submit', 'div' => false));?>
		<input id="keyword" name="keyword" type="text" value="" />
	</form>
</div>